<template>
  <div>
      <template>
         <Tabs  @on-click="handleTab"> 
            <TabPane label="全部订单" name="OrderTotal"></TabPane>
            <TabPane label="新提交"  name="OrderNew"></TabPane>
        </Tabs>
      <component :is="currentTab" keep-alive></component>
    </template>
  </div>
</template>

<script>
import OrderTotal from "./order-total.vue";
import OrderNew from "./order-new.vue";
export default {
  name: "tables_page",
  components: {
   OrderNew,
   OrderTotal
  }, 
  data() {
    return {
       currentTab: 'OrderTotal' // currentTab 用于标识当前触发的子组件
    }
    
  },
  methods: {
    handleTab:function(name){
     this.currentTab = name
    },
  
  },
   
};
</script>

